const PhoneValidator = (errorMsg) => {
  const reg = new RegExp(/^1[3456789]\d{9}$/)
  return (rule, value, callback) => {
    if (!reg.test(value)) {
      callback(new Error(errorMsg))
    } else {
      callback()
    }
  }
}

export default PhoneValidator